<% title = admin.t("titles.edit", default: "Editing %{model_name}") %>

<% content_for(:title, title) %>
<% breadcrumb(title) %>

<% toolbar(:primary) do |t| %>
  <%= t.save_or_dismiss(:update) %>
  <%= hook("edit.toolbar.primary", t) %>
<% end %>

<% toolbar(:secondary) do |t| %>
  <%= t.delete %>
  <%= hook("edit.toolbar.secondary", t) %>
<% end %>

<%= resource_turbo_frame(instance) do %>
  <%= trestle_form_for instance, url: admin.actions.include?(:update) ? admin.instance_path(instance, action: :update) : "#", method: :patch do |f| %>
    <%= render partial: "form", layout: modal_request? ? "modal" : "layout", locals: { wrapper: admin.form.wrapper? } %>
  <% end %>
<% end %>
